home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / WASTE 1.2 / Minimal IC APIs / ICTypes.h < prev   
Text File  |  1996-05-19  |  3KB  |  94 lines

  1. /*
  2.     IMPORTANT NOTES ABOUT THE C CONVERSION
  3.     --------------------------------------
  4.     
  5.     o Pascal "var" parameters are converted from "var x : y" to "y *x".  This
  6.       means that when you see the parameter "y *x" you should be aware that
  7.         you *cannot pass in nil*.  In future this restriction may be eased,
  8.         especially for the attr parameter to ICGetPref.  Parameters where nil
  9.         is legal are declared using the explicit pointer type, ie "yPtr x".
  10.  
  11.     o Strings are *Pascal* strings.  This means that they must be word aligned.
  12.         MPW and Think C do this automatically.  The last time I check, Metrowerks
  13.         C does not.  If it still doesn't, then IMHO it's a bug in their compiler
  14.         and you should report it to them.
  15.  
  16.     o The canonical Internet Config interface is defined in Pascal.  These
  17.         headers have not been thoroughly tested.  If there is a conflict between
  18.         these headers and the Pascal interfaces, the Pascal should take precedence.
  19. */
  20.  
  21. /* ///////////////////////////////////////////////////////////////////////////////// */
  22.  
  23. #ifndef __ICTYPES__
  24. #define __ICTYPES__
  25.  
  26. #ifndef __TYPES__
  27. #include <Types.h>
  28. #endif
  29.  
  30. /* ///////////////////////////////////////////////////////////////////////////////// */
  31.  
  32. #if defined(powerc) || defined (__powerc)
  33. #pragma options align=mac68k
  34. #endif
  35.  
  36. enum {
  37.     icPrefNotFoundErr = -666,        /* preference not found (duh!) */
  38.     icPermErr = -667,                        /* cannot set preference */
  39.     icPrefDataErr = -668,                /* problem with preference data */
  40.     icInternalErr = -669,                /* hmm, this is not good */
  41.     icTruncatedErr = -670,            /* more data was present than was returned */
  42.     icNoMoreWritersErr = -671,    /* you cannot begin a write session because someone else is already doing it */
  43.     icNothingToOverrideErr = -672,    /* no component for the override component to capture */
  44.     icNoURLErr = -673,                        /* no URL found */
  45.     icConfigNotFoundErr = -674,            /* no configuration was found */
  46.     icConfigInappropriateErr = -675    /* incorrect manufacturer code */
  47. };
  48.  
  49. enum {
  50.     ICattr_no_change = 0xFFFFFFFFL,                /* supply this to ICSetPref to tell it not to change the attributes */
  51.     ICattr_locked_bit = 0,                                /* bits in the preference attributes */
  52.     ICattr_locked_mask = 0x00000001L,            /* masks for the above */
  53.     ICattr_volatile_bit = 1,
  54.     ICattr_volatile_mask = 0x00000002L,
  55.     icNoUserInteraction_bit = 0,
  56.     icNoUserInteraction_mask = 0x00000001L
  57. };
  58.  
  59. #define ICfiletype 'ICAp'
  60. #define ICcreator 'ICAp'
  61.  
  62. #define ICdefault_file_name "\pInternet Preferences"    /* default file name, for internal use, overridden by a component resource */
  63.  
  64. struct ICDirSpec {                                            /* a record that specifies a folder */
  65.     short vRefNum;
  66.     long dirID;
  67. };
  68. typedef struct ICDirSpec ICDirSpec;
  69.  
  70. typedef ICDirSpec ICDirSpecArray[4];        /* an array of the above */
  71. typedef ICDirSpecArray *ICDirSpecArrayPtr;    /* a pointer to that array */
  72.  
  73. typedef long ICAttr;                                        /* type for preference attributes */
  74. typedef long ICError;                                        /* type for error codes */
  75. typedef Ptr ICInstance;                                    /* opaque type for preference reference */
  76. enum {
  77.     icNoPerm = 0,
  78.     icReadOnlyPerm = 1,
  79.     icReadWritePerm = 2
  80. };
  81. typedef unsigned char ICPerm;
  82.  
  83. struct ICConfigRef {
  84.     OSType manufacturer;
  85.     /* other private data follows */
  86. };
  87. typedef struct ICConfigRef ICConfigRef, *ICConfigRefPtr, **ICConfigRefHandle;
  88.  
  89. #if defined(powerc) || defined(__powerc)
  90. #pragma options align=reset
  91. #endif
  92.  
  93. #endif
  94.